﻿// 确认

using UnityEngine;
using UnityEngine.UI;
using System;
using System.Collections.Generic;
using MotionFramework.UIKit;

namespace DemoProject
{
    public partial class ConfirmForms : UIWindow
    {
        protected override void OnInit()
        {
            //本窗体属性
            CurrentUIType.UIWindow_Type = UIWindowType.PopUp;
            CurrentUIType.UIWindow_ShowMode = UIWindowShowMode.ReverseChange;

            //事件注册
            AddClickEventListener(m_BtnConfirmButton,ConfirmPurcherGoods);
            AddClickEventListener(m_BtnCancelButton,
                () => CloseUIWindow<ConfirmForms>()
            );
        }//Awake_end

        #region  窗体生命周期
        protected override void OnEnter()
        {
            if (m_TitleText)
            {
                m_TitleText.text = ShowText("ConfirmWindow");
            }
            if (m_TextOkText)
            {
                m_TextOkText.text = ShowText("Confirm");
            }
            if (m_TextCancelText)
            {
                m_TextCancelText.text = ShowText("Cancle");
            }
        }

        protected override void OnReEnter()
        {
            base.OnReEnter();
        }

        protected override void OnFreeze()
        {
            base.OnFreeze();
        }

        protected override void OnExit()
        {
            base.OnExit();
        }
        #endregion

        /// <summary>
        /// 确认(购买物品)
        /// </summary>
        private void ConfirmPurcherGoods()
        {
            //todo...
        }
    }//Class_end
}